<template>
  <div>
    home {{ $route.query }} {{ $store.state.count }}
    <button @click="go">跳到list</button>
    <!-- <button @click="$router.push('/list')">跳到list</button> -->
  </div>
</template>

<script>
import { useRoute, useRouter } from 'vue-router'
export default {
  setup() {
    let route = useRoute() // 等价于vue2的this.$route
    let router = useRouter(); // 等价于vue2的this.$router
    console.log(route.query)
    const go = () => {
      setTimeout(() => {
        router.push({ path: '/list', query: { yy: 666, uuu: 888 } })
      }, 2000);
    }
    return {
      go
    }
  }
}
</script>

<style lang="scss" scoped>
</style>